//
//  VipGuide.m
//  云成绩
//
//  Created by Apple1 on 2017/3/9.
//  Copyright © 2017年 zj. All rights reserved.
//

#import "VipGuide.h"

@implementation VipGuide {
    __weak UIVisualEffectView *_effectView;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    _effectView.frame = self.bounds;

}


- (void)willMoveToSuperview:(UIView *)newSuperview {
    [super willMoveToSuperview:newSuperview];
    if (newSuperview == nil) {
        [_effectView removeFromSuperview];
        return;
    }
    
    UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight];
    UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
    
    effectView.frame = self.bounds;
    [self insertSubview:effectView atIndex:0];
    
    _effectView = effectView;
    
    self.layer.cornerRadius = 3;
    self.layer.borderWidth = 1;
    self.layer.borderColor = [UIColor colorWithHexString:@"FDC337"].CGColor;
    
}

@end
